<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"%>
<%@ taglib uri="http://java.fckeditor.net" prefix="FCK" %>
<HTML>
	<HEAD>
		<TITLE><bean:message key="newscenter.newsmanage.add.title" />
		</TITLE>
		<LINK href="./jsp/manage/css/User_Style.css" type=text/css
			rel=stylesheet>
		<script language="javascript" src="./jsp/manage/js/jquery-1.3.2.min.js"></script>
		<script language="javascript" src="./jsp/manage/js/changedate.js"></script>
	</HEAD>

	<script type="text/javascript">
	//表单校验
	function CheckForm(){
		var str=document.newsForm.title.value.replace(/\s+/g, '');
		if (str==''){
			alert('标题不能为空！');
			document.newsForm.title.focus();
			return false;
		}
		str=document.newsForm.pubdate.value.replace(/\s+/g, '');
		if (str==''){
		   alert('发布时间不能为空！');
		   document.newsForm.pubdate.focus();
		   return false;
		}
		if($("#iftop").attr('checked')==true){
			str=document.newsForm.startdate.value.replace(/\s+/g, '');
			if (str==''){
			   alert('置顶开始时间不能为空！');
			   document.newsForm.startdate.focus();
			   return false;
			}
			str=document.newsForm.enddate.value.replace(/\s+/g, '');
			if (str==''){
			   alert('置顶结束时间不能为空！');
			   document.newsForm.enddate.focus();
			   return false;
			}
		}
		return true;  
	}
	//如果选择了置顶，则启用时间控件
	function top()
	{
		if($("#iftop").attr('checked')==false){
			$("#startdate")[0].disabled=true;
			$("#enddate")[0].disabled=true;
		}else{
			$("#startdate")[0].disabled=false;
			$("#enddate")[0].disabled=false;
		}
	}
	</script>
	<BODY topMargin=0 marginheight="0" marginwidth="0">

		<FORM name="newsForm" onSubmit="return CheckForm();"
			action="<%=request.getContextPath()%>/newsManage.do?method=newssave" method=post
			target=_self>
			<TABLE class=border cellSpacing=0 cellPadding=0 width="100%"
				align=center border=0>
				<TBODY>
					<TR class=topbg>
						<TD height=22 colSpan=2 align=middle></TD>
					</TR>
					<TR align=middle>
						<TD>
							<TABLE cellSpacing=1 cellPadding=2 width="100%" border=0>
								<TBODY>
									<TR class=tdbg>
										<TD align=right width=9%>
											&nbsp;
										</TD>
										<TD colspan="10">
											<FONT color=#ff0000><STRONG>注意<font color="#0000ff">*的内容必须填</font></STRONG></FONT>
										</TD>
									</TR>
									<TR class=tdbg>
										<TD align=right width=9%>
											<STRONG>标题</STRONG>
										</TD>
										<TD colspan="10">
											<input id="title" maxlength=255 size=50 name="title">
											<FONT color=#ff0000>*</FONT>
										</TD>
									</TR>
									<TR class=tdbg id=ArticleContent>
										<TD align=right width=9%>
											<STRONG> 文章作者 </STRONG>
											<div align="left">
												<input name="writer" type="hidden" value="${writer}">
											</div>
										</TD>
										<TD colspan="1" class="my1">
											<div align="center">
												<font color=blue> ${writer} </font>
											</div>
										</TD>
										<TD align=right width=9%>
											<STRONG>发布时间</STRONG>
										</TD>
										<TD width="17%" class="my1">
											<STRONG> <input
													name="pubdate" id="pubdate" value="" size="10"
													onclick='popUpCalendar(this, this, &quot;yyyy-mm-dd&quot;)' /></STRONG>
										</TD>
										<TD width="8%" class="my1">
											置顶
										</TD>
										<TD width="3%" class="my1">
											<input type="checkbox" name="iftop" id="iftop" onclick="top()"/>
										</TD>
										<TD width="54%" colspan="5" class="my1">
											置顶开始时间
											<input name="startdate" id="startdate" value="" size="10"
												onclick='popUpCalendar(this, this, &quot;yyyy-mm-dd&quot;)' disabled="disabled"/>
											置顶结束时间
											<input name="enddate" id="enddate" value="" size="10"
												onclick='popUpCalendar(this, this, &quot;yyyy-mm-dd&quot;)' disabled="disabled"/>
										</TD>
									</TR>
									<TR class=tdbg id=ArticleContent>
										<TD vAlign=center align=right width=9%>
										</TD>
										<TD colspan="10">
										<FCK:editor instanceName="newscontent">
											<jsp:attribute name="value">
											</jsp:attribute>
											<jsp:body>
												<FCK:config FullPage="true"/>
											</jsp:body>
										</FCK:editor>
										</TD>
									</TR>
								</TBODY>
							</TABLE>
						</TD>
					</TR>
				</TBODY>
			</TABLE>
			<P align=center>
				<INPUT id="Save" style="CURSOR: hand" type="submit" value="添加" name="Save">
				<INPUT id="Cancel" style="CURSOR: hand" type="reset" value="取消" name="Cancel">
			</P>
			<BR>
		</FORM>
	</BODY>
</HTML>
